<template>
    <div>
      <FormPanel
        ref="from"
        :list="formList"
        :cols="3"
        :formType="type"
        @formChange="changeHandle"
        :isSubmitBtn="false"
        labelWidth="120" />
      <div class="dialogBottmView" >
        <el-button @click="closeDrawer()">关 闭</el-button>
      </div>
    </div>
</template>

<script>
  export default {
    name: "dealwithdetail",
    data() {
      this.saveData=null;
      return{
        formList: this.createTopFilterList(),
      };
    },
    props: {
      type: {
        type: String,
        default: 'add'
      },
      rowData: {
        type: Object,
        default: () => ({})
      }
    },
    created() {
      this.formList.forEach(x => {
        x.initialValue = this.rowData[x.fieldName];
      });
    },
    methods:{
      closeDrawer(){
        this.$emit('close')
      },
      createTopFilterList(){
        return[
          {
            type: 'DATE',
            label: '处理时间',
            format:'yyyy-MM-dd HH:mm:ss',
            initialValue: new Date(),
            disabled:true,
            fieldName: 'handleTime'
          },
          {
            type: 'INPUT',
            label: '处理人',
            fieldName: 'handleBy',
            rules: [
              {
                required: true,
                message: '必填',
                trigger: 'change'
              }
            ]
          },
          {
            type: 'INPUT',
            label: '处理人联系方式',
            fieldName: 'phone',
            maxlength:11,
            rules: [
              {
                required: true,
                message: '必填',
                trigger: 'blur'
              },
              {
                pattern: /^1(3|4|5|6|7|8|9)\d{9}$/,
                message: '请填写正确的手机格式',
                trigger: 'blur'
              }
            ]
          },
          {
            type: 'TEXT_AREA',
            label: '处理结果',
            fieldName: 'content',
            placeholder: '请输入',
            initialValue: '',
            selfCols:2, //独占行数
            rules: [
              {
                required: true,
                message: '必填',
                trigger: 'change'
              }
            ]
          },
          {
            type: 'TEXT_AREA',
            label: '备注',
            fieldName: 'remarks',
            placeholder: '请输入',
            initialValue: '',
            selfCols:2, //独占行数
          },
        ]
      },
      changeHandle(val) {
        this.saveData=val;
      },
    }
  };
</script>

<style scoped>

</style>
